package mx.com.crowdgine.assetloader;

import javax.media.opengl.GL2;

import mx.com.crowdgine.display.animation.Animation;
import mx.com.crowdgine.util.math.Vector3f;

public class OBJModelAsset implements Asset {

	private OBJModel model;
	private String assetName;
	private boolean loaded = false;
	private Animation animation;
	
	
	@Override
	public int getAssetType() {
		return OBJ_MODEL_TYPE;
	}

	@Override
	public Object getRelatedAsset() {
		return model;
	}
	
	@Override
	public void setAssetName(String assetName) {
		this.assetName = assetName;
	}
	
	@Override
	public boolean isLoaded() {
		return loaded;
	}
	
	public void load(GL2 gl) {
		this.model = new OBJModel(this.assetName, gl);
		this.loaded = true;
	}
	
	@Override
	public Animation getAnimation() {
		return this.animation;
	}
	
	@Override
	public void setAnimation(Animation animation) {
		this.animation = animation;
	}
	
	public void translate(Vector3f pos){
		model.translate(pos);
	}

}
